package cn.edu.zust.se.service.file.service;

import cn.edu.zust.se.api.entity.File;
import cn.edu.zust.se.api.entity.bo.FileChunkDTO;
import cn.edu.zust.se.api.entity.vo.FileChunkResultDTO;
import cn.edu.zust.se.api.entity.vo.FileVo;
import cn.edu.zust.se.api.entity.bo.FileBo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.http.ResponseEntity;

import java.io.FileNotFoundException;
import java.io.IOException;

import java.util.List;


public interface FileService extends IService<File> {
    List<File> getFilesByFolderId(Long folderId,Integer type);
    void test();

    void insertFile(File uploadFile);

    FileVo getFileByMd5(String md5);

    Boolean instantTransmit(Long fileId, Long folderId);
    List<File> queryList(FileBo fileBo,Integer type);


    ResponseEntity<byte[]> download(Long fileId) throws IOException;

    byte[] downloadFile(Long fileId);

    Boolean clearAllByUserId(Long userId);

    Boolean clearFileById(Long id);

    Boolean recycle(Long fileId);

    boolean move(FileBo fileBo);

    FileVo check(String identifier, Long folderId);

    Boolean copyFile(Long fileId, Long folderId);

    FileChunkResultDTO checkChunkExist(FileChunkDTO chunkDTO);

    void uploadChunk(FileChunkDTO chunkDTO);

    Long getRootFolderId(Long userId);
    boolean mergeChunk(String identifier, String filename, Integer totalChunks, Long folderId) throws FileNotFoundException;
}
